home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Subview Layout
- Sent: 3/12/96 12:41 PM
- Received: 3/12/96 11:52 AM
- From: laurentd@apple.com
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
-
- >I have a subclass of FW_CGadget whose subview layout depends on calling
- >methods that need a graphic context. FW_CView::CreateSubViews does not
- >provide one.
- >
- >I have seen two strategies to work around the lack of a graphic context:
- >defer geometry computations or use a FW_CScreenContext. Both have their
- >pros and cons, but I am not sure what they are. And in the case of deferred
- >geometry, I am not sure where is the place to do the actual computation.
-
- In the current release (d11) you should defer layout management code to
- your frame's method AdjustSubViews() which is called from
- FW_CFrame::FrameShapeChanged. Although this won't be called the first
- time the frame is created when opening a document or a stationary
- (except if your code changes the size of the window).
-
- For a new frame the right place is to override FW_CFrame::FacetAdded
- (or FW_CEmbeddedFrame::FacetAdded). Call Inherited::FacetAdded first,
- this will call your CreateSubView method, and then change your subview
- layout. In FacetAdded use the frame's graphic context for that facet:
-
- FW_CViewContext gc(ev, this, odFacet, NULL);
-
- Note: in ODF 1, you won't have to implement CreateSubViews() if you use
- resources and AdjustSubViews() has disappeared. ODF provides a simple
- layout management scheme based on binding flags (left, right, top, bottom,
- width and height). You can override it with your own layout code by
- implementing AdjustToNewLayout() in your view classes.
- I will check that it allows to do what you asked for.
-
- >I think a document on that subject would be a nice addition to ODF in the
- >next release.
-
- Yes, we have planned a separate Engineering note covering Layout
- management
- of views in ODF 1. This will be merged later in the Developer Guide.
-
- --Laurent
- ODF Team
-